package com.fulihui.systemcore.common;

import java.text.ParseException;
import java.util.Date;

import org.near.toolkit.common.DateUtils;
import org.near.toolkit.model.ToString;

import com.google.common.base.Throwables;

/**
 * DTO基类
 * @author leeson 2016年3月4日 下午2:41:40
 * 
 */
public class BaseDTO extends ToString {
    private static final long serialVersionUID = -1492595767663944452L;

    /** 创建时间 */
    private String            gmtCreate;
    /** 修改时间 */
    private String            gmtModified;

    public String getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(String gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public String getGmtModified() {
        return gmtModified;
    }

    public void setGmtModified(String gmtModified) {
        this.gmtModified = gmtModified;
    }

    public Date parseGmtCreate() {
        try {
            return DateUtils.parseNewFormat(gmtCreate);
        } catch (ParseException e) {
            throw Throwables.propagate(e);
        }
    }

    public Date parseGmtModified() {
        try {
            return DateUtils.parseNewFormat(gmtModified);
        } catch (ParseException e) {
            throw Throwables.propagate(e);
        }
    }
}